Skip to content

feat: Visual Theming Engine + Expanded Preset Library#36

Open
alohays wants to merge 5 commits intomainfrom
feat/theming-and-presets
Open

feat: Visual Theming Engine + Expanded Preset Library#36
alohays wants to merge 5 commits intomainfrom
feat/theming-and-presets

Conversation

@alohays
Copy link
Owner

@alohays alohays commented Mar 8, 2026

Summary

Together: forge preset apply cyber-full now gives a cyberpunk-themed threat intelligence dashboard with map data — not a generic dark page.

Closes #29, Closes #30

Key Changes

Theming (forge/src/theme/, forge/src/commands/theme.ts)

  • ThemeSchema added to config — mode, palette, custom colors, panelPosition, panelWidth, compactMode
  • 7 palettes with both dark and light color sets in palettes.ts
  • resolver.ts merges palette + custom colors + branding fallback
  • theme-resolved.ts added as 5th build manifest
  • App.ts injects CSS variables at runtime, listens for OS theme changes in auto mode
  • base.css extended with light mode, auto mode, compact mode, left-panel layout

Presets (presets/, data/geo/)

  • 8 new preset JSONs: cyber-minimal/full, climate-minimal/full, korea-minimal/full, health-minimal/full
  • 7 GeoJSON files: tech-hubs, financial-centers, conflict-zones, threat-origins, natural-disasters, korean-peninsula, who-regions
  • All 7 full-tier presets now have map layers referencing domain GeoJSON
  • All 15 presets have _meta blocks (category, difficulty, required/optional API keys)
  • preset list now shows category and difficulty columns
  • Domain-specific branding colors and palette assignments

Test plan

  • npx tsc --noEmit — typecheck clean
  • npx vitest run650 tests pass (34 test files)
    • 32 palette tests (all 7 palettes, hex validation, dark+light sets)
    • 10 resolver tests (default resolution, branding fallback, palette priority, custom override)
    • 106 preset tests (15 presets × 7 assertions each including _meta validation)
    • 105 pipeline tests (15 presets × 7 manifest generation assertions)
  • Pre-push hooks pass (manifests, typecheck, tests, validate)
  • forge theme set --palette ocean && forge dev — visual verification
  • forge preset apply cyber-full && forge validate && forge dev — end-to-end

🤖 Generated with Claude Code

alohays and others added 5 commits March 7, 2026 17:12
Single command to go from zero to running dashboard. Uses @clack/prompts
for a 5-step interactive wizard (name, preset, map, AI, create) and
supports --non-interactive --format json for agent use.

Closes #28

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eck, test assertions

- Validate config with MonitorForgeConfigSchema.parse() before writing (matches updateConfig pattern)
- Skip interactive overwrite prompt during --dry-run
- Reject invalid --projection values in non-interactive mode
- Assert config content in interactive wizard test
- Add test for invalid projection rejection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…env permissions

- Wrap preset JSON.parse() in try-catch at 3 locations (loadPresets,
  buildAndWrite, interactive wizard) so a single corrupted preset file
  doesn't crash the entire setup command
- Add NaN and coordinate range validation for non-interactive --center
  (longitude -180..180, latitude -90..90) with clear error messages
- Set chmod 0600 on .env.local after writing to protect API keys
- Switch vi.clearAllMocks() → vi.resetAllMocks() to prevent mock leakage
- Add 6 new tests: invalid center (NaN, out-of-range, single value),
  dry-run with existing config, malformed preset JSON, chmod verification
- Strengthen interactive happy-path assertions (slug, sources, panels,
  dayNightOverlay)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a complete visual theming system and expand the preset library
from 7 to 15 presets across 7 domains. Each preset now ships with
a distinctive palette, branding colors, and map layers with GeoJSON
data — transforming the out-of-box experience from "generic dark
dashboard" to domain-specific intelligence views.

Theming engine (#30):
- ThemeSchema with mode (dark/light/auto), 7 palette presets,
  custom accent colors, panel position, width, and compact mode
- `forge theme set` and `forge theme status` CLI commands
- Runtime CSS variable injection in App.ts with OS theme listener
- Light mode, auto mode, compact mode, and left-panel CSS layouts
- Build-time theme resolution via theme-resolved.ts manifest

Expanded presets (#29):
- 8 new presets: cyber, climate, korea, health (minimal + full tiers)
- 7 domain-specific GeoJSON files with 87 total data points
- Map layers added to all 7 full-tier presets
- _meta blocks on all 15 presets (category, difficulty, API keys)
- `preset list` now shows category and difficulty metadata
- Domain-specific branding colors and palette assignments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant